package org.SimpleSpringBoot.user;

import org.SimpleSpringBoot.annotation.Autowired;
import org.SimpleSpringBoot.web.RequestMapping;
import org.SimpleSpringBoot.web.RestController;

/**
 * 问候控制器
 */
@RestController
public class HelloController {

    @Autowired
    private MessageService messageService;

    /**
     * 问候接口
     */
    @RequestMapping("/hello")
    public String hello() {
        return messageService.getWelcomeMessage();
    }

    /**
     * 发送消息接口
     */
    @RequestMapping("/send")
    public String send() {
        return messageService.sendMessage("Hello, Simple Spring Boot!");
    }
}